Hue问题记录

您所在的位置:网站首页 server does not support getlog Hue问题记录

Hue问题记录

#Hue问题记录| 来源: 网络整理| 查看: 265

make的一开始如果报错:python2.4 /root/hue-master/tools/virtual-bootstrap/virtual-bootstrap.py \

-qq --no-site-packages /root/hue-master/build/env

虽然/usr/bin/python已经是2.7版本,但是不知怎会调用到/usr/bin/python2.4,修改后即可:

ln -s /usr/bin/python2.7 /usr/bin/python2.4

vim ./tools/virtual-bootstrap/virtual-bootstrap.py,可以看到第33行说明了python必须是2.6以上的版本:

ERROR: this script requires Python 2.6 or greater

maven开始组建之前报错,提示JDK版本不对,升级之后正常,错误提示如下:

Detected JDK Version: 1.6.0-24 is not in the allowed range [1.7.0,1.7.1000].

在安装python模块的时候报错:AttributeError: 'NoneType' object has no attribute 'clone'

从以上信息可以发现,应该是easy_install版本不对,之前错误的调用了python2.4导致生成了easy_install2.4的版本,

从 ./build/env/bin/目录中可以发现,还有一个easy_install2.7,

报的这个没有属性clone的错误正是easy_install或者bootstrap.py的bug。

参见:https://github.com/diefenbach/django-lfs/issues/73、Python easy_install的一个问题

easy_install setuptools==dev06 && make clean && make apps

启动服务后若网页显示django错误:attempt to write a readonly database或 unable to open database file,

是因为目录或文件权限不够,导致sqlite无法访问到数据库文件及临时文件。

参考:Django-想说爱你真不容易--解决“Unable to open database file”,修改命令如下:

chmod 777 hue-master/desktop/ chmod 766 hue-master/desktop/desktop.db

about页显示配置错误:not able to access the filesystem,同时webhdfs无法连接造成File Browser组件无效,

应该是没有启用webhdfs_api接口,参考:Hue File Browser not working、Configure HDP,分别作如下配置:

    hadoop.proxyuser.hue.hosts     *     hadoop.proxyuser.hue.groups     *     dfs.webhdfs.enabled     true

注意要设置hue的启动用户为hdfs代理用户以访问webhdfs_api,默认为hue,可在hue.ini中修改。

若没有配置代理用户,则在hue-master/logs/error.log中发现:

WebHdfsException: SecurityException: Failed to obtain user group information:

org.apache.hadoop.security.authorize.AuthorizationException: User: hue is not allowed to impersonate admin (error 401)

上述修改之后即可浏览hdfs文件系统,但是hue仍显示配置错误:Filesystem root '/' should be owned by 'hdfs'

参考:Filesystem root '/' should be owned by 'hdfs' shows when configuration with hue,

找到文件 ./desktop/libs/hadoop/src/hadoop/fs/webhdfs.py,

将”DEFAULT_HDFS_SUPERUSER = hdfs“修改为当前用户,即root或hue,虽然该设置不影响实际功能使用.

about页显示配置错误:The application won't work without a running HiveServer2.,同时打开hive相关组件报错:

TApplicationException: Required field 'client_protocol' is unset!

Struct:TOpenSessionReq(client_protocol:null, username:admin, configuration:{hive.server2.proxy.user=admin})

参考:Hue 3.0 (Beeswax (Hive UI)) and Hive 0.11 errors,

编辑文件 ./apps/beeswax/src/beeswax/server/hive_server2_lib.py,

在该行“req = TOpenSessionReq(**kwargs)”上方添加:kwargs.update({'client_protocol': 0})

beeswax查询时提示:Server does not support GetLog()

原因是apache hive中不提供这个API,因此没有查询日志,但是在CDH版本中才有,可以通过打补丁的形式可以实现该功能。参考:

hue3.5 - hive server2 logs not visible、Better error reporting by async threads in HiveServer2、

HS2 should support an API to retrieve query logs

若编译出现错误:cannot find symbol symbol : class ThriftTaskInProgress或 hue ImportError: No module named thrift_util

可能是下载版本不对或源文件不全重新下载hue-release或者在github上找到相应文件复制过去,

参考:(hue 3.6.0 )make apps error , can not build hue,实际上是文件丢失造成编译出错,源码包则却是zip压缩.

启动成功后无法使用hive,报错:got an unexpected keyword argument 'password'

查看 ./apps/beeswax/src/beeswax/server/hive_server2_lib.py 第332行,发现是多了一个属性:password=password

然后再次查看hue-release中的源码发现并没有这一句…删掉后metastore正常.

about页显示配置错误:Hive Editor – Failed to access Hive warehouse: /user/hive/warehouse

vim ./apps/beeswax/src/beeswax/conf.py找到第138行,

因为我修改了hive属性 hive.metastore.warehouse.dir 到/hive/warehouse,

而这个类中写死了是默认路径,修改成新路径后重启即可.

打开metastore查看表结构时发现某张表异常:'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)

报错行是mako模板编译后生成在/tmp目录的python文件,原因是MySQL hive数据库中存的是utf8编码,字符转换出错。

定位到该模板的第158行,./apps/metastore/src/metastore/templates/describe_table.mako,修改为:

${ smart_unicode(name) } ${ smart_unicode(value) }

about页显示配置错误:Resource Manager – Failed to contact Resource Manager at http://master:8088/ws/v1

由于集群是hadoop1.0.3,因此需要关闭YARN,修改hue配置文件:submit_to=False

升级到hive0.13后,hue3.5无法正常工作,hue提示如下:

Bad status for request TFetchResultsReq(operationHandle=TOperationHandle(hasResultSet=False, modifiedRowCount=None, operationType=0

或 org.apache.hive.service.cli.HiveSQLException: Invalid SessionHandle: SessionHandle

参考:hue 3.5.0 not work with hive 0.13、HUE-2095 [beeswax] Do not fetch statements without a resultset

原因:查看patch提供的TCLIService.thrift,第504行结构体TOperationHandle的定义中有说明,布尔值hasResultSet如果为true,

则operation回调会生成一个可获取的结果集,注意这个结果集不为None但是可能size=0,

若为false,则返回的结果集为None,这时再去遍历就会抛异常。

修复:下述方法由难到易任选其一

升级hue到3.6版本,下载地址:hue.zip,或使用git下载后重新安装:git clone http://github.com/cloudera/hue.git 将现有的hue3.5合并分支到3.6版本(风险较大,未经测试),查看分支:git branch -l 将2095提供的补丁加上(测试发现补丁有问题,apply失败,对git不熟):git apply -check TCLIService.thrift 直接修改python文件:hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py: class HiveServerDataTable(DataTable): def __init__(self, results, schema, operation_handle): self.schema = schema and schema.schema self.operation_handle = operation_handle if results is not None: self.row_set = HiveServerTRowSet(results.results, schema) self.has_more = not self.row_set.is_empty() # Should be results.hasMoreRows but always True in HS2 self.startRowOffset = self.row_set.startRowOffset # Always 0 in HS2 ----------------------------------------------------------------------------------------- def fetch_result(self, operation_handle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=1000): if operation_handle.hasResultSet: meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle) schema = self.call(self._client.GetResultSetMetadata, meta_req) fetch_req = TFetchResultsReq(operationHandle=operation_handle, orientation=orientation, maxRows=max_rows) res = self.call(self._client.FetchResults, fetch_req) else: schema = None res = None return res, schema

升级到最新版3.8后,打开beeswax报错:

Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found

解决(来自 http://blog.sina.com.cn/s/blog_40d46ec20101fd4s.html):

yum -y install cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi

新版Hue about页检测配置结果中提示HDFS跟目录‘/’的所属用户必须是HDFS,于是修改:

hdfs dfs -chown -R hdfs:hdfs / hdfs dfs -chmod -R 777 /tmp

注意要将/tmp目录修改为所有者权限,否则hiveserver2检测异常,无法使用 beeswax 等app,

查看Hue日志(http://master:8888/logs)发现报错:

Permission denied: user=hue, access=EXECUTE, inode="/tmp":hdfs:hdfs:drwxrwx---

Hbase app报错:

无法联系到 HBase Thrift 1 服务器:Could not connect to localhost:9090

原因是没有启动Hbase Thrift 服务(RPC端口是9090,Web地址是 master:9095):

nohup hbase thrift start > thrift.log 2>&1 &

参考:Starting the HBase Thrift and REST APIs

自检提示:Spark Editor The app won’t work without a running Livy Spark Server

官方说是Hue版本与Spark又不兼容了。解决办法:

./build/env/bin/hue livy_server

参考:Get started with Spark: deploy Spark Server and compute Pi from your Web Browser 评论部分

修改hue.ini 中的app_blacklist 后无法启动,报错:AttributeError: 'Config' object has no attribute 'get'

原因:app间相互依赖,如oozie和jobsub等。可在app.reg中查看到所有已安装app。

参考:https://groups.google.com/a/cloudera.org/forum/#!topic/hue-user/PpvyX82FAv8

to be continued..


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3